<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<script type="text/javascript">
window.onload= function(){
//Find the element with an ID of 'main'
var obj = document.getElementById("main");
alert(obj);
// Change it's border styling
obj.style.border = "1px solid red";

// Initialize a callback that will occur in one second
setTimeout(function(){
    // Which will hide the object
   obj.style.display = 'none';
}, 1000);

// A generic function for displaying a delayed alert message
function delayedAlert( msg, time ) {
    // Initialize an enclosed callback
    setTimeout(function(){
        // Which utilizes the msg passed in from the enclosing function
        alert( msg );
    }, time );
}

// Call the delayedAlert function with two arguments
delayedAlert( "Welcome!", 2000 );
};
</script>

<title>Closure Test</title>
</head>
<body>

<div id="main">
This is the text
</div>


</body>
</html>